/* ============ 日期选择器容器 ============ */

.datepicker-wrapper {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    display: flex;
    gap: 20px;
}

/* ============ 快捷选项 ============ */

.datepicker-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 100px;
}

.shortcut-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    text-align: left;
}

.shortcut-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============ 日期选择器主体 ============ */

.datepicker-main {
    flex: 1;
}

.datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.datepicker-nav-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.datepicker-nav-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.month-year {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ 周日期头 ============ */

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 0;
}

/* ============ 日期单元格 ============ */

.datepicker-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.date-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.date-cell.other-month {
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: default;
}

.date-cell:not(.other-month):not(.disabled):hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.date-cell.today {
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.date-cell.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.date-cell.in-range {
    background: rgba(0, 102, 204, 0.1);
    color: var(--text-primary);
}

.date-cell.disabled {
    color: var(--text-secondary);
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============ 底部按钮 ============ */

.datepicker-footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.datepicker-footer .btn {
    padding: 8px 20px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.datepicker-footer .btn-primary {
    background: var(--primary-color);
    color: white;
}

.datepicker-footer .btn-primary:hover {
    opacity: 0.9;
}

.datepicker-footer .btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.datepicker-footer .btn-secondary:hover {
    background: var(--border-color);
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .datepicker-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .datepicker-shortcuts {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: auto;
    }

    .shortcut-btn {
        flex: 1;
        min-width: 80px;
    }

    .date-cell {
        font-size: 12px;
    }

    .month-year {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .datepicker-wrapper {
        padding: 12px;
    }

    .datepicker-dates {
        gap: 2px;
    }

    .date-cell {
        font-size: 11px;
    }

    .weekday {
        font-size: 11px;
        padding: 6px 0;
    }

    .datepicker-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}
